package com.hashcoding.eyes.ui.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.hashcoding.eyes.R;

import jp.wasabeef.glide.transformations.CropCircleTransformation;
import uk.co.senab.photoview.PhotoViewAttacher;

public class PhotosViewActivity extends BaseActivity {

    ImageView mImageView;
    PhotoViewAttacher mAttacher;

    String mUrl;

    public static void luanch(Context context, String url) {
        Intent intent = new Intent(context, PhotosViewActivity.class);
        intent.putExtra("url", url);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_photos_view);

        mUrl = getIntent().getStringExtra("url");

        // Any implementation of ImageView can be used!
        mImageView = (ImageView) findViewById(R.id.image);

        // Set the Drawable displayed
        Glide.with(this).load(mUrl)
                .placeholder(R.color.default_image)
                .into(mImageView);

        // Attach a PhotoViewAttacher, which takes care of all of the zooming functionality.
        mAttacher = new PhotoViewAttacher(mImageView);
    }
}
